package com.yuchen.ishop.entity;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Table;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.validation.constraints.Pattern;

/**
 * @author Jack Q
 */
@Table("t_buyers")
public class Buyer implements Serializable {

    @Id
    private Long id;

    @Pattern(regexp = "^\\w{4,20}$")
    @Column("account")
    private String account;

    @Pattern(regexp = "^[0-9a-zA-Z]{8,20}$")
    @Column("password")
    private String password;

    @Column("salt")
    private String salt;

    @Column("email")
    private String email;

    @Column("tel")
    private String tel;

    @Column("alias_name")
    private String aliasName;

    @Column("total_score")
    private Long totalScore;

    @Column("use_score")
    private Long useScore;

    @Column("create_time")
    private Timestamp createTime;

    @Column("last_login_at")
    private Timestamp lastLoginAt;

    @Column("state")
    private Short state;

    @Column("identification")
    private Short identification = 0;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    public String getAliasName() {
        return aliasName;
    }

    public void setAliasName(String aliasName) {
        this.aliasName = aliasName;
    }

    public Long getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(Long totalScore) {
        this.totalScore = totalScore;
    }

    public Long getUseScore() {
        return useScore;
    }

    public void setUseScore(Long useScore) {
        this.useScore = useScore;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public Timestamp getLastLoginAt() {
        return lastLoginAt;
    }

    public void setLastLoginAt(Timestamp lastLoginAt) {
        this.lastLoginAt = lastLoginAt;
    }

    public Short getState() {
        return state;
    }

    public void setState(Short state) {
        this.state = state;
    }

    public Short getIdentification() {
        return identification;
    }

    public void setIdentification(Short identification) {
        this.identification = identification;
    }
}
